/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package network.packets;

import utils.Utils;

/**
 *
 * @author Kvest
 */
public class TimerCorrectorResponce extends Packet
{
    private int correction;
    
    public TimerCorrectorResponce(byte[] data)
    {
        super(TIMER_CORRECTOR_RESPONCE, data);
    }
    
    public void parse(byte[] data)
    {
        int offset = 2;

        //Время корректировки
        byte[] tmp = new byte[4];
        System.arraycopy(data, offset, tmp, 0, tmp.length);
        offset += tmp.length;
        correction = Utils.byteToInt(tmp);

        tmp = null;
    }
    
    public void print()
    {
        System.out.println("TimerCorrectorResponce={correction=" + correction + "}");
    }

    public int getCorrection() 
    {
        return correction;
    }
}
